#! /bin/mksh

usage ()
{
	echo "Usage: $(basename "$0") <directory>"
}

if [ "$#" -ne 1 ]
then
	echo "Bad number of arguments!"
	usage
	exit 0
fi

if [ "$1" = "" ]
then
	echo "Missing argument!"
	usage
	exit 0
fi

TARGETDIR="$(realpath "$1")"
FINDEXEC="$(dirname $(realpath "$0"))/.fix-filenames-routine.sh"
#echo "$FINDEXEC"
find "$TARGETDIR" -type f -exec mksh "$FINDEXEC" "{}" \& \;
